package com.event;

import com.service.ProcessLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * ClassName:LoginEventListener
 * Package:com.event
 *
 * @Date:2024/7/20 16:30
 * @Author:zxde
 */
@Component
@Slf4j
public class LoginEventListener implements ApplicationListener<LoginEvent> {


    @Autowired
    ProcessLoginService processLoginService;

    @Override
    public void onApplicationEvent(LoginEvent loginEvent) {
        Date loginTime = loginEvent.getLoginTime();
        String caseId = loginEvent.getCaseId();
        String num = loginEvent.getNum();

        log.info("loginTime:{}",loginTime);
        log.info("caseId:{}",caseId);
        log.info("num:{}",num);
    }

/*    @EventListener
    public void loginListen(LoginEvent loginEvent){
        Date loginTime = loginEvent.getLoginTime();
        String caseId = loginEvent.getCaseId();
        String num = loginEvent.getNum();

        log.info("loginTime:{}",loginTime);
        log.info("caseId:{}",caseId);
        log.info("num:{}",num);
    }*/

}
